package com.kakarote.hrm.constant;

import com.kakarote.core.common.enums.SystemCodeEnum;
import com.kakarote.core.exception.CrmException;

/**
 * @Author 92487
 * @Date 2024/5/13 10:19
 */

public enum HrmHighestEducationEnum {

    PRIMARY(1, "小学"),
    MIDDLE(2, "初中"),
    high(3, "高中"),
    polytechnic(4, "中专"),
    JUNIOR_COLLEGE(5, "大专"),
    UNIVERSITY(6, "大学"),
    master(7, "硕士"),
    doctor(8, "博士");

    HrmHighestEducationEnum(Integer status, String msg) {
        this.status = status;
        this.msg = msg;
    }

    private final Integer status;
    private final String msg;

    public Integer getStatus() {
        return status;
    }

    public String getMsg() {
        return msg;
    }

    public static HrmHighestEducationEnum parse(Integer status) {
        for (HrmHighestEducationEnum hrmHighestEducationEnum : values()) {
            if (hrmHighestEducationEnum.getStatus().equals(status)) {
                return hrmHighestEducationEnum;
            }
        }
        throw new CrmException(SystemCodeEnum.SYSTEM_NO_VALID);
    }
}
